<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <div id="app">
      <h2>{{msg}}</h2>
      <input type="text" v-model='msg'>
      <button @click='destroy'>destroy</button>
  </div>
  <script src="./vue.js"></script>
  <script>
    var vm = new Vue({
      el:'#app',
      data:{
          msg:"hello vue"
      },
      methods:{
        destroy() {
              this.$destroy()
          }
          
      },
      beforeCreate() {
              console.log(this);
              console.log('beforeCreate');
              console.log(this.$el);
              console.log(this.$data);
          },
        created() {
            console.log('------');
            console.log('created');
            console.log(this.$el);
            console.log(this.$data);

        },
        beforeMount() {
            console.log('------');
            console.log('beforeMount');
            console.log(this.$el);
            console.log(this.$data);

        },
        mounted() {
            console.log('------');
            console.log('mounted');
            console.log(this.$el);
            console.log(this.$data);

        },
        beforeUpdate() {
            console.log('------');
            console.log('beforeUpdate');
            console.log(this.$el);
            console.log(this.msg);
        },
        updated() {
            console.log('------');
            console.log('updated');
            console.log(this.$el);
            console.log(this.msg);
        },
        beforeDestroy() {
            console.log('------');
            console.log('beforeDestroy');
            console.log(this.$el);
            console.log(this.$data);
        },
        destroyed() {
            console.log('------');
            console.log('destroyed');
            console.log(this.$el);
            console.log(this.$data);
        },


     });
  </script>
</body>
</html>
